package exp1;

public class NineMultiplication {
    public static void main(String[] args) {
        for (int i = 1; i < 10; i++) {
            for (int j = 1; j <=i ; j++) {
                System.out.print(j+"*"+i+"="+i*j+" ");
                if(i*j<10){
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
        System.out.println();
        for (int i = 1; i < 10; i++) {
            for (int j = 1; j < 10 ; j++) {
                if(i>j){
                    System.out.print("       ");
                }else{
                    System.out.print(i+"*"+j+"="+i*j+" ");
                    if(i*j<10){
                        System.out.print(" ");
                    }
                }

            }
            System.out.println();
        }
        System.out.println();
        for (int i = 1; i < 10; i++) {
            for (int j = 10; j > i; j--) {
                System.out.print("    ");
            }
            for (int j = 1; j <=i ; j++) {
                System.out.print(j+"*"+i+"="+i*j+"  ");
                if(i*j<10){
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
